#include <QApplication>
#include <iostream>
#include <QObject>
#include "qtuiolistener.h"

#include "TUIO/TuioClient.h"

#include "dice.h"

int main(int argc, char *argv[]){
	
	QApplication app(argc, argv);
        if(!QGLFormat::hasOpenGL())
	{
		std::cerr << "This system has no OpenGL support" << std::endl;	
		return 1;
	}

	Dice dice;

        QTuioListener *myListener = new QTuioListener();
        TuioClient *tuioClient = new TuioClient();
        tuioClient->addQTuioListener(myListener);
        tuioClient->connect();

        dice.setWindowTitle(QObject::tr("DICE"));
	dice.resize(600,600);

        QObject::connect(myListener, SIGNAL(touch(int , double ,double , int )), &dice, SLOT(tuioCursor(int ,double ,double , int )));

	dice.show();

	return app.exec();





}
